package com.sfx.controller;

import com.sfx.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2022-11-13
 * Time: 21:48
 */
@Controller
public class UserController3 {

//    @Autowired//type + name
//    private User user;
//    @Resource(name = "user2")//指定SpringBean的名称
//    private User user;

    @Autowired
    private User user;

    public void doController(){
        System.out.println("do UserController3");
        System.out.println("user id" + user.getId() + "|" + "user name : " + user.getName());
    }

}
